<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"  %>
<%@ page import="com.kaisheng.util.IntervalUtil" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>项目管理系统</title>
	<link rel="stylesheet" href="static/css/bootstrap.min.css"/>
	<style type="text/css">
		body{
			background-image:url(static/img/bg.png);
		}
	</style>
	
</head>
<body class="body">
	<div class="navbar navbar-fixed-top">
		<div class="navbar-inner">
			<div class="container">
				<a href="#" class="brand">Kaishengit PMS</a>
			</div>
		</div>
	</div>
	<div class="container" style="border:2px solid #ddd;">
		<div class="row" style="margin-top:60px">
			<div class="span3">
				<div style="padding:15px">
					<ul class="nav nav-list">
						<li class="nav-header" style="font-size:14px">${sessionScope.userProject.project.name }</li>
						<li class="divider"></li>
						<li><a href="project.jspx"><i class="icon-home"></i>最新动态</a></li>
						<li><a href="goal.jspx"><i class="icon-flag"></i>目标</a></li>
						<li><a href="document.jspx"><i class="icon-folder-open"></i>资料库</a></li>
						<li><a href="files.jspx"><i class="icon-file"></i>文件共享</a></li>
						<li class="active"><a href="contact.jspx"><i class="icon-white icon-user"></i>联系人</a></li>
						<li><a href="idea.jspx"><i class="icon-fire"></i>想法</a></li>
						<li><a href="#"><i class="icon-warning-sign"></i>Bug</a></li>
						<li><a href="set.jspx"><i class="icon-cog"></i>项目设置</a></li>
					</ul>
				</div>									
			</div>
			<div class="span9">
				<ul class="breadcrumb" style="margin-bottom:0px;border-bottom:none">
					<li class="active">
						<a href="#"><i class="icon-user"></i>联系人</a>
					</li>					
				</ul>
				<div style="border:1px solid #ddd;padding:5px">
					<div class="row">
						<div class="span3">
							<div class="container" style="padding:10px">
								<button class="btn span2" id = "addbtn">
									<i class="icon-plus"></i>添加联系人					
								</button><br />
							
							<c:forEach items = "${contactList}" var = "lianxiren">
							<ul class="unstyled" style="margin-top:15px">
								<li style="line-height:30px">
									<a href = "contact.jspx?m=show&id=${lianxiren.id }"><i class="icon-list-alt"></i>${lianxiren.name }</a>
								</li>
							</ul>
						</c:forEach>
						
							</div>
						
						</div>
						<div class="span5" style="padding:15px;border-left:1px solid #ccc">
						<img style = "float:right" src = "contact.jspx?m=showCode&id=${contact.id }"/>
						
							<address>
								<h3> ${contact.name }</h3>
								<small> ${contact.company }</small><br /><br />
								<small>手机&nbsp;&nbsp; ${contact.cellphone }</small><br />
								<small>固话&nbsp;&nbsp;${contact.phone }</small><br /><br />
								<small>邮箱&nbsp;&nbsp;${contact.email }</small><br />
								<small>地址&nbsp;&nbsp;${contact.address}</small><br /><br />
								<small>主页&nbsp;&nbsp;${contact.homepage }</small><br />
								<small>微博&nbsp;&nbsp;${contact.weibo }</small><br />							
						
							</address>
							<div>记录<hr /></div>
										<c:forEach items = "${cuList}" var = "cu">
																	<c:set value="${cu.createtime }" var="time"></c:set>
																			<%String time = (String)pageContext.getAttribute("time"); %>
											<div>
													<div class="row">
														<div class="span1">							
																<img style = "padding-left:10px" alt="" src="contact.jspx?m=showImg&img=${cu.user.pic }">
														</div>
														<div class = "span3">
																<blockquote>
																 ${cu.event }
																  <small>${cu.user.name }发布于<%=IntervalUtil.getInterval(time) %></small>
																</blockquote>
														</div>				
												
													</div>
											</div>
										</c:forEach>
							<div>
							<a href="contact.jspx?m=note&id=${contact.id}">查看所有记录</a><br /><br />
							<a class="btn btn-primary" href="contact.jspx?m=edit&id=${contact.id}"><i class="icon-pencil icon-white"></i>编辑</a>
							<a class="btn btn-danger" href="contact.jspx?m=del&id=${contact.id }" id = "delbtn"><i class="icon-trash icon-white"></i>删除</a>
							</div>
						</div>
						
				
					</div>
				
				
				</div>
				
			</div>
		</div>
		
	
	</div>
	
				<script type = "text/javascript">
							document.getElementById("addbtn").onclick = function(){
								window.location.href = "contact.jspx?m=add";
							
							};
							
						
						
				</script>
			
 
	
	
	
</body>
</html>

